package com.lspopi.demo.jetbrick.ext;

import java.io.IOException;

import jetbrick.collection.TimedSizeCache;
import jetbrick.template.JetAnnotations;
import jetbrick.template.runtime.JetTagContext;
@JetAnnotations.Tags
public class MyTags {
	private static final TimedSizeCache cache = new TimedSizeCache(128);
	public static void tagsMyself(JetTagContext context,String name,int timeout) throws IOException{
		Object value = cache.get(name);
		if(value==null){
			System.out.println("---");
			value = context.getBodyContent();
			cache.put(name, value,timeout);
		}
		System.out.println("=="+value);
		context.getWriter().print(value.toString());
	}
}
